{{ if .Site.Params.widgets.tags }}
{{ if isset .Site.Taxonomies "tags" }}
{{ if not (eq (len .Site.Taxonomies.tags) 0) }}
{{$lan := index (split .URL "/") 1 }}
{{if ne $lan "zh-cn"}}
{{$lan = "" }}
{{else}}
{{$lan = "zh-cn/" }}
{{end}}
<div class="panel sidebar-menu">
    <span class="post-blog">
        <a href={{ i18n "BLOG_LINK"}} target="_blank" >
            <img class="post-img" src="{{ "img/blogs/Post_Green.svg" | relURL}}" alt="edit">
            {{ i18n "MAIN_POSTBLOG_SOURCE"}}
        </a>
    </span>
    <div class="panel-heading">
        <h3 class="panel-title">{{ i18n "SIDEBAR_TAG" }}</h3>
    </div>

    <div class="panel-body">
        <ul class="tag-cloud">
            {{ $current := . }}
            {{ $currentTag := index (split $current "/") 2}}
            {{ $currentTag := index (split $currentTag ")") 0}}
            {{ range $index, $items :=  .Site.Taxonomies.tags }}
            {{ if eq $index $currentTag }}
            <li><a href="{{ $.Site.BaseURL }}{{$lan}}blog.html" class="selectedTag"> {{ $index }}</a></li>
            {{ else}}
            <li><a href="{{ $.Site.BaseURL }}{{$lan}}tags/{{ $index | urlize }}.html"> {{ $index }}</a></li>
            {{ end }}
            {{ end }}
        </ul>
    </div>

</div>
{{ end }}
{{ end }}
{{ end }}
